// Copyright © SixtyFPS GmbH <info@slint.dev>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0

component Text2 inherits  Text {}

export component TestCase inherits Window {
    width: 100phx;
    height: 100phx;
    // The style provides the default font size. Some tests in the CI run with the Qt style, some with our built-in styles.
    // The built-in styles don't provide a default font size, so the testing backend provides the last resort fallback.
    // To provide a consistent test environment, don't use the style's default font size.
    default-font-size: 10px;
    simple-text := Text { }

    complex-text := Text {
        stroke-width: 2px;
    }

    inherit-text := Text2 {}

    text-input := TextInput { }

    out property <bool> test: simple-text.font-metrics.ascent == complex-text.font-metrics.ascent && complex-text.font-metrics.ascent == text-input.font-metrics.ascent
        && inherit-text.font-metrics.ascent == simple-text.font-metrics.ascent && text-input.font-metrics.ascent == 7px;
}

/*
```rust
let instance = TestCase::new().unwrap();
assert!(instance.get_test());
```

```cpp
auto handle = TestCase::create();
const TestCase &instance = *handle;
assert(instance.get_test());
```

```js
let instance = new slint.TestCase({});
assert(instance.test);
```

*/
